<script language="javascript">
    var _login_agreed_term2 = "{$_TR.agree_term_policy_alert}";
</script>
<div class="textmodule">

    {* Map *}
    {if $conf->show_map == 1}
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <div id="map_{$__loc->src}" class="contactmodule_map"></div>

    <script language="javascript">
        var locationmap = [{ldelim}
            coordinate: "{$conf->lat_long1}".split(","),
            info: '<div id="content">'+'{$conf->location_des}'+'</div>',
            marker: null
        {rdelim},
        {ldelim}
            coordinate: "{$conf->lat_long2}".split(","),
            info: '<div id="content">'+'{$conf->location_des2}'+'</div>'
        {rdelim}];
        var m_zoom=18;
        var infowindow = new google.maps.InfoWindow({ldelim}
            content: ""
        {rdelim});      

        var abmap;
        //var _location=new google.maps.LatLng(locationmap[0].coordinate[0], locationmap[0].coordinate[1]);
        var _location=new google.maps.LatLng(41.069615,29.011912);
        var mapOptions = {ldelim}
            zoom: m_zoom,
            mapTypeControl: true,
            center: _location,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        {rdelim};
        abmap = new google.maps.Map(document.getElementById('map_{$__loc->src}'),mapOptions);
        
        var ab_mapsbounds = new google.maps.LatLngBounds();
        for (var i=0;i<1;i++){ldelim}
            locationmap[i].marker = new google.maps.Marker({ldelim}
                map:abmap,
                draggable:false,
                animation: google.maps.Animation.DROP,
                position: new google.maps.LatLng(locationmap[i].coordinate[0], locationmap[i].coordinate[1]),
                index: i
            {rdelim});
            
            infowindow.setContent(locationmap[i].info);
            infowindow.open(abmap,locationmap[i].marker);
            
            ab_mapsbounds.extend(new google.maps.LatLng(locationmap[i].coordinate[0], locationmap[i].coordinate[1]));
            
            google.maps.event.addListener(locationmap[i].marker, 'click', function() {ldelim}
                var index=this.index;
                infowindow.setContent(locationmap[index].info);
                infowindow.open(map,locationmap[index].marker);
            {rdelim});
            
        {rdelim}
        
        //abmap.fitBounds(ab_mapsbounds);
        
        function ShowMarker(index){ldelim}
            abmap.panTo(locationmap[parseInt(index)].marker.getPosition());           
               
                 var infowindow = new google.maps.InfoWindow({
    content: locationmap[index].info
  });
  infowindow.open(map,locationmap[index].marker);
                
                
            google.maps.event.trigger(locationmap[parseInt(index)].marker, 'click');
        {rdelim}

        jQuery(document).ready(function(){ldelim}
            jQuery(".click_map").click(function() {ldelim}
                var index = jQuery(this).attr("rev");
                ShowMarker(parseInt(index));
            {rdelim});
        {rdelim});

    </script>

    {else}
    {if $conf->show_map == 2}
    <div id="map_{$__loc->src}" class="contactmodule_map">{$conf->location_des}</div>                    
    {else}
    <!--<img src="{$smarty.const.THEME_RELATIVE}modules/contactmodule/images/bible.jpg" border=0 align=right style="margin-right: 40px;">-->
    {/if}
    {/if}
    {* End Map*}
</div>
</div>
<div class="sep-2"></div>
<div class="row ">
<div class="one_third first">

    <div class="contact_content_wrapper">
        {assign var="contact_text_src" value="`$smarty.const.LANG`_contact"}
        {chain module="textmodule" view="Kurtulus Credit - Black Header" src=$contact_text_src title=""}
    </div>
</div>

{if $numContacts != 0}
<div class="two_thirds last"> <div class="wpcf7" id="wpcf7-f12617-p8529-o1">
        {form name=contact action=contact class="wpcf7-form"}

        {control type=hidden name=msg value="_Default"}

        <table border = 0 style="width:100%" class="contact_name">
            <tr>            
                <td>{$_TR.first_name}</td>
                <td>{$_TR.last_name}</td>
            </tr>
            <tr>            
                <td style="vertical-align: top;">                
                    <input type=text size=20 class="control text required" name="first_name" style="width: 95%;">
                </td>
                <td style="vertical-align: top;">                
                    <input type=text size=20 class="text required " name="last_name" style="width: 100%;">

                </td>
            </tr>
        </table>

        <p>{$_TR.email}<br>
        <span class="wpcf7-form-control-wrap your-email control text required"><input type="text" name="email" value="" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" size="40"></span> </p>
        <p>{$_TR.telephone}<br>
        <span class="wpcf7-form-control-wrap your-subject control text required"><input type="text" name="telephone" value="" class="wpcf7-form-control wpcf7-text" size="40"></span> </p>
        <p>{$_TR.message}<br>
            <span class="wpcf7-form-control-wrap your-message control text required"><textarea name="message" class="wpcf7-form-control  wpcf7-textarea" cols="40" rows="10"></textarea></span> 
        </p>
        <div id="captcha_stringControl" class="control">
            <p>{$_TR.captcha}<br>
                <img class="captcha-img" src="/captcha.php" height="26" style="float: left; ">&nbsp;
                <input class="wpcf7-form-control wpcf7-text text required" type="text" name="captcha_string" value="" size="34">
            </p>
        </div>


        <p><input type="submit" class="login_button" id="contact_button" value="{$_TR.send}"></p>
    <div class="wpcf7-response-output wpcf7-display-none"></div></form></div> </div>
{/form}
<br>
{literal}
<script language='javascript'>
    jQuery(document).ready(function(){
    jQuery("#contact_textareaControl > label > textarea").addClass("required");
    jQuery("#captcha_stringControl > label > input").addClass("required");
    jQuery('#contact').validate();

    jQuery("#contact_button").click(function(){
    if (jQuery("#agreed2").attr("checked")!= "checked")
    {
    alert(_login_agreed_term);
    return false;
    }
    if (jQuery('#contact').valid())
    {
    //ajax_loader_show(jQuery("#contact_waiting"));
    jQuery("#contact_waiting").fadeIn();
    jQuery(this).attr("disabled", "disabled").hide();
    jQuery(this).parents("form").submit();
    }
    else
    {
    jQuery("#contact_waiting").fadeOut();
    jQuery(this).removeAttr("disabled").show();
    }
    });
    });
    </script>
    {/literal}

{else}
    {if $smarty.const.PREVIEW_READONLY == 1 || $permissions.configure == 1}
        {$_TR.no_contacts}<br>
    {/if}
{/if}
{permissions level=$smarty.const.UILEVEL_NORMAL}
        {if $permissions.configure == 1}
            <a href="{link action=manage_contacts}">{$_TR.manage_contacts}</a>
        {/if}
{/permissions}
{* End contact form *}